package Lesson;

import javax.swing.*;
import java.lang.reflect.Array;
import java.util.Scanner;

public class ClassTest {
    public static char[] array= new char[8];
    public static Scanner scan=new Scanner(System.in);
    public static void main(String[] args) {
        search();
        reverse(array);
    }

//    学生的英文状态转换
    public static void search(){
        String ch=JOptionPane.showInputDialog(null,"输入学生的英文状态");
        switch (ch){
            case "A":
            case "a":
                JOptionPane.showMessageDialog(null,"优秀");
                break;
            case "G":
            case "g":
                JOptionPane.showMessageDialog(null,"良好");
                break;
            case "F":
            case "f":
                JOptionPane.showMessageDialog(null,"不及格");
                break;
            case "S":
            case "s":
                JOptionPane.showMessageDialog(null,"中等");
                break;
            default:
                JOptionPane.showMessageDialog(null,"输入有误，重新输入");
                break;
        }
        isGo();
    }
    public static void isGo(){
        String is=JOptionPane.showInputDialog(null,"是否继续  y/n");
        if(is.equals("y")){
            search();
        }else if(is.equals("n")){
            System.exit(0);
        }else {
            JOptionPane.showMessageDialog(null,"选择有误");
            again();
        }
    }
    public static void again(){
        isGo();
    }

    //反转
    public static void reverse(char[] a){
        String aa=JOptionPane.showInputDialog(null,"输入八个数字");
        char b[]=aa.toCharArray();
        a=b;
        for (int i=0;i<array.length/2;i++){
            char temp=a[i];
            a[i]=a[a.length-1-i];
            a[a.length-1-i]=temp;
        }
        for (int i=0;i<array.length;i++){
            System.out.print(a[i]+"  ");
        }
    }
}
